import 'package:flutter/material.dart';

class OrderDetail extends StatelessWidget {
  OrderDetail({super.key, this.id});

  String? id = '';

  @override
  Widget build(BuildContext context) {
    // 获取路由参数
    final pageParams = ModalRoute.of(context)?.settings.arguments;
    print(pageParams);
    print(id);
    return Scaffold(
      appBar: AppBar(
        title: const Text('订单详情页'),
      ),
      body: Column(
        children: [
          // 手势组件
          GestureDetector(
            child: const Text('返回上一页-文本'),
            // 点击
            onTap: () {
              // 返回上一页
              Navigator.pop(context);
            },
          ),
          // 点击按钮返回上一页
          ElevatedButton(
            onPressed: () {
              Navigator.pop(context);
            },
            child: const Text('返回上一页'),
          )
        ],
      ),
    );
  }
}
